<?php
if ($this->pageCount) {
    $pre_class = "prev";
    $pre_url = "#";
    $pages = "";
    $next_cls = "next";
    $next_url = "#";


    // Lien vers page précédente
    if (isset($this->previous)) {
        $pre_url = $this->url(array('page' => $this->previous));
    } else {
        $pre_class .= " disabled";
    }

    // Lien pages intermediaires
    foreach ($this->pagesInRange as $page) {
        if ($page != $this->current) {
            $pages .= "<li><a href=" . $this->url(array('page' => $page)) . ">" . $page . "</a></li>";
        } else {
            $pages .= "<li class=\"active\"><a href=\"#\">" . $page . "</a></li>";
        }
    }

    // Lien page suivante
    if (isset($this->next)) {
        $next_url = $this->url(array('page' => $this->next));
    } else {
        $next_cls .= " disabled";
    }
    ?>
    <div class="pagination" style=" bottom: 120px;position: absolute;">
        <ul>
            <li class="<?php echo $pre_class; ?>"><a href="<?php echo $pre_url; ?>" >&larr; Précédent</a></li>
            <?php echo $pages ?>
            <li class="<?php echo $next_cls; ?>"><a href="<?php echo $next_url; ?>" >Suivant &rarr;</a></li>
        </ul>
    </div>

<?php } ?>
